def sum1(x):
    result=0
    for each in x:
        if isinstance(each,int or float):
            result +=  each
        else :
            continue
    return result
print(sum1([1,3,'a','1',True]))



'''isinstance 判断True 和False   为int 导致程序出错'''
